<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>EasyIO-GPRS-Framework: api.h源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- 制作者 Doxygen 1.6.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="modules.html"><span>模块</span></a></li>
      <li><a href="annotated.html"><span>类</span></a></li>
      <li class="current"><a href="files.html"><span>文件</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <img id="MSearchSelect" src="search/search.png"
             onmouseover="return searchBox.OnSearchSelectShow()"
             onmouseout="return searchBox.OnSearchSelectHide()"
             alt=""/>
        <input type="text" id="MSearchField" value="搜索" accesskey="S"
             onfocus="searchBox.OnSearchFieldFocus(true)" 
             onblur="searchBox.OnSearchFieldFocus(false)" 
             onkeyup="searchBox.OnSearchFieldChange(event)"/>
        <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
        </div>
      </li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>文件列表</span></a></li>
      <li><a href="globals.html"><span>文件成员</span></a></li>
    </ul>
  </div>
<h1>api.h</h1><a href="api_8h.html">浏览该文件的文档。</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 ﻿
<a name="l00015"></a>00015 <span class="preprocessor">#ifndef __easy_io_api_h__</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">#define __easy_io_api_h__</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span>
<a name="l00018"></a>00018 <span class="preprocessor">#include &quot;<a class="code" href="api__type_8h.html" title="结构体类型">api_type.h</a>&quot;</span>
<a name="l00019"></a>00019 <span class="preprocessor">#include &quot;<a class="code" href="api__result_8h.html" title="API函数返回值描述.">api_result.h</a>&quot;</span>
<a name="l00020"></a>00020 
<a name="l00021"></a><a class="code" href="api_8h.html#a80a290edcdf5934b2bbda8eada5c3a52">00021</a> <span class="preprocessor">#define HOOK                    </span>
<a name="l00022"></a><a class="code" href="api_8h.html#aefb2aa75be4323fe06eb3ec8394bdfc7">00022</a> <span class="preprocessor">#define INTERFACE extern        </span>
<a name="l00024"></a><a class="code" href="api_8h.html#afabb8cdc9450ec537c0bee641a9fda90">00024</a> <span class="preprocessor">#define EI_MALLOC rt_malloc     </span>
<a name="l00025"></a><a class="code" href="api_8h.html#a0044eb38af0014e6521a14a72d05a2f5">00025</a> <span class="preprocessor">#define EI_FREE rt_free         </span>
<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="comment">/****************************************************************</span>
<a name="l00029"></a>00029 <span class="comment">        EasyIO 功能接口函数</span>
<a name="l00030"></a>00030 <span class="comment">****************************************************************/</span>
<a name="l00031"></a>00031 
<a name="l00040"></a>00040 <a class="code" href="api_8h.html#aefb2aa75be4323fe06eb3ec8394bdfc7">INTERFACE</a> <span class="keywordtype">int</span> <a class="code" href="api_8h.html#a59df66cde845e58fbcce79eafb42b5ee">ReadSerial</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buffer , <span class="keywordtype">int</span> max , <span class="keywordtype">int</span> timeout);
<a name="l00041"></a>00041 
<a name="l00048"></a>00048 <a class="code" href="api_8h.html#aefb2aa75be4323fe06eb3ec8394bdfc7">INTERFACE</a> <span class="keywordtype">int</span> <a class="code" href="api_8h.html#a78cc5c993ce3e0c72ddc38c7de1b6d83">SerialPrintf</a>(<span class="keywordtype">char</span> *fmt, ...);
<a name="l00049"></a>00049 
<a name="l00057"></a>00057 <a class="code" href="api_8h.html#aefb2aa75be4323fe06eb3ec8394bdfc7">INTERFACE</a> EIResult_t <a class="code" href="api_8h.html#a1a7008f48872b20f41bd83290e4705e5">WriteSerial</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buffer , <span class="keywordtype">int</span> size);
<a name="l00058"></a>00058 
<a name="l00059"></a>00059 
<a name="l00068"></a>00068 <a class="code" href="api_8h.html#aefb2aa75be4323fe06eb3ec8394bdfc7">INTERFACE</a> EIResult_t <a class="code" href="api_8h.html#acfa681e48122da0da490adb8b19d8ece">ReadEEPROM</a>(<span class="keywordtype">int</span> pos , <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buffer , <span class="keywordtype">int</span> size);
<a name="l00069"></a>00069 
<a name="l00078"></a>00078 <a class="code" href="api_8h.html#aefb2aa75be4323fe06eb3ec8394bdfc7">INTERFACE</a> EIResult_t <a class="code" href="api_8h.html#a59935c90d54edd81607ba01ed7d02957">WriteEEPROM</a>(<span class="keywordtype">int</span> pos , <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buffer , <span class="keywordtype">int</span> size);
<a name="l00079"></a>00079 
<a name="l00084"></a>00084 <a class="code" href="api_8h.html#aefb2aa75be4323fe06eb3ec8394bdfc7">INTERFACE</a> EIResult_t <a class="code" href="api_8h.html#a66cebdf06835f6d6b9c7ec77d84f7099">GetLocation</a>();
<a name="l00085"></a>00085 
<a name="l00093"></a>00093 <a class="code" href="api_8h.html#aefb2aa75be4323fe06eb3ec8394bdfc7">INTERFACE</a> EIResult_t <a class="code" href="api_8h.html#a7f277cbc25c344a82fb50c809fb3ca3b">SendSms</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *phonenum ,<span class="keyword">const</span> <span class="keywordtype">char</span> *body);
<a name="l00094"></a>00094 
<a name="l00102"></a>00102 <a class="code" href="api_8h.html#aefb2aa75be4323fe06eb3ec8394bdfc7">INTERFACE</a> EIResult_t <a class="code" href="api_8h.html#a4c362ba910ffadc54d3d7b0d95bf9b94">SendTcpData</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *buffer , <span class="keywordtype">int</span> size);
<a name="l00103"></a>00103 
<a name="l00111"></a>00111 <a class="code" href="api_8h.html#aefb2aa75be4323fe06eb3ec8394bdfc7">INTERFACE</a> EIResult_t <a class="code" href="api_8h.html#a6f4a24bbde5f08822dacb0e5fca2acae">SendP2paMsg</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *imei , <span class="keyword">const</span> <span class="keywordtype">char</span> *body);
<a name="l00112"></a>00112 
<a name="l00120"></a>00120 <a class="code" href="api_8h.html#aefb2aa75be4323fe06eb3ec8394bdfc7">INTERFACE</a> EIResult_t <a class="code" href="api_8h.html#a1b26a329aa3aa5e962809722a37e21f6">SendXmppMsg</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * to , <span class="keyword">const</span> <span class="keywordtype">char</span> *body);
<a name="l00121"></a>00121 
<a name="l00130"></a>00130 <a class="code" href="api_8h.html#aefb2aa75be4323fe06eb3ec8394bdfc7">INTERFACE</a> <span class="keywordtype">int</span> <a class="code" href="api_8h.html#acb3f64b85678bbeaad49e856e894d6ad">HttpRequest</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *url, <span class="keyword">const</span> <span class="keywordtype">char</span> *UserHeader ,<span class="keywordtype">char</span> *RespBuffer , <span class="keywordtype">int</span> RespBufSize);
<a name="l00131"></a>00131 
<a name="l00132"></a>00132 
<a name="l00138"></a>00138 <a class="code" href="api_8h.html#aefb2aa75be4323fe06eb3ec8394bdfc7">INTERFACE</a> EIResult_t <a class="code" href="api_8h.html#a3821ab5f141aaa49aa7da5f8caf3e580">GetSysInfo</a>(<span class="keyword">struct</span> <a class="code" href="structSysInfo.html">SysInfo</a> *info);
<a name="l00139"></a>00139 
<a name="l00144"></a>00144 <a class="code" href="api_8h.html#aefb2aa75be4323fe06eb3ec8394bdfc7">INTERFACE</a> EIResult_t <a class="code" href="api_8h.html#a2a69f03277a975ab59fb363b54e8942c">ResetSystem</a>();
<a name="l00145"></a>00145 
<a name="l00150"></a>00150 <a class="code" href="api_8h.html#aefb2aa75be4323fe06eb3ec8394bdfc7">INTERFACE</a> EIResult_t <a class="code" href="api_8h.html#a0e1c8e962bd88c2df5fb6a54865545a6">ResetGprs</a>();
<a name="l00151"></a>00151 
<a name="l00152"></a>00152 
<a name="l00153"></a>00153 <span class="comment">/****************************************************************</span>
<a name="l00154"></a>00154 <span class="comment">        钩子函数</span>
<a name="l00155"></a>00155 <span class="comment">****************************************************************/</span>
<a name="l00156"></a>00156 
<a name="l00164"></a>00164 <span class="keyword">extern</span> <a class="code" href="api_8h.html#a80a290edcdf5934b2bbda8eada5c3a52">HOOK</a> void (*RecvSms)(<span class="keyword">const</span> <span class="keywordtype">char</span> *phonenum , <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *str);
<a name="l00165"></a>00165 
<a name="l00174"></a>00174 <span class="keyword">extern</span> <a class="code" href="api_8h.html#a80a290edcdf5934b2bbda8eada5c3a52">HOOK</a> void (*RecvWeChat)(<span class="keyword">const</span> <span class="keywordtype">char</span> *from , <span class="keyword">const</span> <span class="keywordtype">char</span> *msg , EIResult_t(*relpy)(<span class="keywordtype">char</span> *msg));
<a name="l00175"></a>00175 
<a name="l00183"></a>00183 <span class="keyword">extern</span> <a class="code" href="api_8h.html#a80a290edcdf5934b2bbda8eada5c3a52">HOOK</a> void (*RecvTcpData)(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> * buffer , <span class="keywordtype">int</span> size);
<a name="l00184"></a>00184 
<a name="l00192"></a>00192 <span class="keyword">extern</span> <a class="code" href="api_8h.html#a80a290edcdf5934b2bbda8eada5c3a52">HOOK</a> void (*RecvP2pMsg)(<span class="keywordtype">char</span> *imei , <span class="keywordtype">char</span> *msg);
<a name="l00193"></a>00193 
<a name="l00201"></a>00201 <span class="keyword">extern</span> <a class="code" href="api_8h.html#a80a290edcdf5934b2bbda8eada5c3a52">HOOK</a> void (*RecvXmppMsg)(<span class="keywordtype">char</span> *from , <span class="keywordtype">char</span> *body);
<a name="l00202"></a>00202 
<a name="l00203"></a>00203 
<a name="l00204"></a>00204 <span class="comment">/****************************************************************</span>
<a name="l00205"></a>00205 <span class="comment">        初始化函数</span>
<a name="l00206"></a>00206 <span class="comment">****************************************************************/</span>
<a name="l00207"></a>00207 
<a name="l00214"></a>00214 <a class="code" href="api_8h.html#aefb2aa75be4323fe06eb3ec8394bdfc7">INTERFACE</a> EIResult_t <a class="code" href="api_8h.html#a4b93413c1716a933b70ff024609531f9">InitSerial</a>(<span class="keyword">struct</span> <a class="code" href="structSerialOption.html">SerialOption</a> *option);
<a name="l00215"></a>00215 
<a name="l00222"></a>00222 <a class="code" href="api_8h.html#aefb2aa75be4323fe06eb3ec8394bdfc7">INTERFACE</a> EIResult_t <a class="code" href="api_8h.html#a009e64f475ff55b9627e9705d8d3c590">InitDtu</a>(<span class="keyword">struct</span> <a class="code" href="structDtuOption.html">DtuOption</a> *option);
<a name="l00223"></a>00223 
<a name="l00230"></a>00230 <a class="code" href="api_8h.html#aefb2aa75be4323fe06eb3ec8394bdfc7">INTERFACE</a> EIResult_t <a class="code" href="api_8h.html#a6c87ac370cc3c561d7bc5fc4527dc627">InitXmpp</a>(<span class="keyword">struct</span> <a class="code" href="structXmppOption.html">XmppOption</a> *option);
<a name="l00231"></a>00231 
<a name="l00236"></a>00236 <a class="code" href="api_8h.html#aefb2aa75be4323fe06eb3ec8394bdfc7">INTERFACE</a> EIResult_t <a class="code" href="api_8h.html#a5ab96a061e08adee4a93aca4e050257c">InitEasyIOCloud</a>();
<a name="l00237"></a>00237 
<a name="l00238"></a>00238 <span class="comment">/****************************************************************</span>
<a name="l00239"></a>00239 <span class="comment">        系统级回调函数</span>
<a name="l00240"></a>00240 <span class="comment">****************************************************************/</span>
<a name="l00241"></a>00241 
<a name="l00246"></a>00246 <span class="keywordtype">void</span> <a class="code" href="api_8h.html#a951592d1b14d7bebd76b61fa3f670b88">InitBoard</a>();
<a name="l00247"></a>00247 
<a name="l00252"></a>00252 <span class="keywordtype">void</span> <a class="code" href="api_8h.html#a567fcfb601dc83cc9691ce515ce5a474">Startup</a>();
<a name="l00253"></a>00253 
<a name="l00258"></a>00258 <span class="keywordtype">void</span> <a class="code" href="api_8h.html#a153a5fd8946b6ab9fd9b725759fffe5e">MainLoop</a>();
<a name="l00259"></a>00259 
<a name="l00260"></a>00260 <span class="preprocessor">#endif</span>
</pre></div></div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>全部</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>类</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>文件</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>函数</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>变量</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>枚举</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>枚举值</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&nbsp;</span>宏定义</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address style="text-align: right;"><small>Generated at Thu Dec 26 21:32:02 2013 for EasyIO-GPRS-Framework by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>
